import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:top_foundation/top_foundation.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class LoginPage extends GetView<LoginController> {
  const LoginPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return Column(
      children: [
        UITextField(
          title: '手机号',
          hintText: '请输入手机号',
          prefixText: '手机号',
          // prefix: Text('手机号'),
          keyboardType: TextInputType.phone,
          style: TextFieldStyle.outLine,
          margin: EdgeInsets.fromLTRB(30.r, 30.r, 30.r, 0),
          isClear: true,
        ),
        UITextField(
          title: '密码',
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<LoginController>(
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("login")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
